package org.kamionowski.supreme.persistence.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.Collection;
import javax.persistence.SequenceGenerator;

/**
 * Created by IntelliJ IDEA.
 * User: Marcin Kamionowski
 * Date: 13.04.11
 * Time: 16:07
 */
@javax.persistence.Table(name = "search_host", schema = "public", catalog = "")
@Entity
public class Host implements Serializable {
    private Integer id;

    @javax.persistence.Column(name = "id", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    @Id
    @SequenceGenerator(name="hostSeq")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private Boolean active;

    @javax.persistence.Column(name = "isactive", nullable = false, insertable = true, updatable = true, length = 1, precision = 0)
    @Basic
    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    private String fullHostName;

    @javax.persistence.Column(name = "fullhostname", nullable = false, insertable = true, updatable = true, length = 255, precision = 0)
    @Basic
    public String getFullHostName() {
        return fullHostName;
    }

    public void setFullHostName(String fullHostName) {
        this.fullHostName = fullHostName;
    }

    private Long contentSize;

    @javax.persistence.Column(name = "content_size", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Long getContentSize() {
        return contentSize;
    }

    public void setContentSize(Long size) {
        this.contentSize = size;
    }

    private Collection<HostIP> hostIPs;
    @OneToMany(mappedBy = "host")
    public Collection<HostIP> getHostIPs() {
        return hostIPs;
    }

    public void setHostIPs(Collection<HostIP> hostIPs) {
        this.hostIPs = hostIPs;
    }



    private Collection<Service> services;

    @OneToMany(mappedBy = "host")
    public Collection<Service> getServices() {
        return services;
    }

    public void setServices(Collection<Service> services) {
        this.services = services;
    }

    @Override
    public String toString() {
        return this.fullHostName;
    }
}
